<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $this->title;?></title>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/css/main.css" />
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/jquery.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/load.js"></script>
<!--时间选择器-->
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/lang/cn_utf8.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar-setup.js"></script>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar-blue.css" />
<!--colorbox-->
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/jquery.colorbox.js"></script>

<!-- member-source-subsource 展开 -->
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/dayData/expandClose.js"></script>
<!-- member-source-subsource 展开 -->

<link href="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/colorbox2.css" rel="stylesheet" type="text/css"/>

</head>


<body style="overflow:auto;">
	<div id="main">
		<div id="topMenu">
			<div id="navigation">当前位置：<?php echo $this->title;?></div>
			<div id="topOtherMenu"></div>
		</div>
		<div id="body">
			<div id="search">
				<form id="searchForm" name="searchForm" method="post" action="<?php echo $this->projectUrl(array('action'=>$this->reportType,'day'=>'between'));?>">
					<table>
						<tr>
							<td >
                            
                            <!-- 时间选择条 -->
                            <div id="timeRange">
                            <span
                            <?php if($this->key=='yestoday'):?>
                             class="currentTimeRange"
                             <?php endif;?>
                            ><a href="<?php echo $this->projectUrl(array('action'=>$this->reportType,'day'=>'yestoday'));?>">昨天</a></span>
                            <span  <?php if($this->key=='last-seven-day'):?>
                             class="currentTimeRange"
                             <?php endif;?>><a href="<?php echo $this->projectUrl(array('action'=>$this->reportType,'day'=>'last-seven-day'));?>">最近7天</a></span>
                            <span  <?php if($this->key=='last-thirty-day'):?>
                             class="currentTimeRange"
                             <?php endif;?>
                             ><a href="<?php echo $this->projectUrl(array('action'=>$this->reportType,'day'=>'last-thirty-day'));?>">最近30天</a></span>
                            <span  <?php if($this->key=='last-three-month'):?>
                             class="currentTimeRange"
                             <?php endif;?>
                             ><a href="<?php echo $this->projectUrl(array('action'=>$this->reportType,'day'=>'last-three-month'));?>">最近三个月</a></span>
                            <span
                             <?php if($this->key=='all'):?>
                             class="currentTimeRange"
                             <?php endif;?>
                            ><a href="<?php echo $this->projectUrl(array('action'=>$this->reportType,'day'=>'all'));?>">全部</a></span>
                            
                            &nbsp;&nbsp;&nbsp;&nbsp;
                            <span
                             <?php if($this->key=='between'):?>
                             class="currentTimeRange"
                             <?php endif;?>
                            >日期选择</span>：
                            <input name="startTime" type="text" class="input" id="startTime" size="18" value="<?php echo $this->startTime;?>" />
								<script type="text/javascript">Calendar.setup({"ifFormat":"%Y-%m-%d","firstDay":0,"showsTime":true,"showOthers":false,"timeFormat":24,"inputField":"startTime","button":"startTime"});</script>
-
<input name="endTime" type="text" class="input" id="endTime" size="18" value="<?php echo $this->endTime;?>" />
<script type="text/javascript">Calendar.setup({"ifFormat":"%Y-%m-%d","firstDay":0,"showsTime":true,"showOthers":false,"timeFormat":24,"inputField":"endTime","button":"endTime"});</script>
                            <input name="search" type="submit" id="search2" value="查找" class="button" />
                            &nbsp;</div>
                            <!-- 时间选择条 -->						  </td>
					  </tr>
					</table>

            <span>广告渠道</span>
				
					<table class="table reportTable" style="width:auto;" >
						<tr class="subject">
							<td>渠道类型</td>
                            <td>Source Id</td>
                            <td>Source Sub Id</td>
							<td>订单金额</td>
							<td>订单量</td>
                           
							<td>客单价</td>
                      
						  <td>激活量</td>
                       
						  <td>激活用户提交订单量</td>
                          <td>激活用户提交订单金额</td>
                       
					    </tr>
                        <?php if (count($this->totals)):?>
                       <?php foreach($this->totals as $key=>$row):?>
                       <tr class="dataLine data-show-<?php echo ($key+2)%2+1;?>">
                       <?php if ($key == '0'):?>
						 <td colspan="3">
                         <span style="cursor:pointer;" class="expandAdMember" id="expandAdMember">+</span>
                         <input name="expandAdMemberUrl" id="expandAdMemberUrl" type="hidden" value="<?php echo $this->projectUrl(array('action'=>'expand-ad-member'));?>" />
                         广告渠道</td>
                       <?php elseif ($key == '1'):?>
                       <td colspan="3">
                       <span style="cursor:pointer;" class="expandFreeMember" id="expandFreeMember">+</span>
                         <input name="expandFreeMemberUrl" id="expandFreeMemberUrl" type="hidden" value="<?php echo $this->projectUrl(array('action'=>'expand-free-member'));?>" />
                       其他渠道</td>
                       <?php else:?>
                       <td colspan="3" style="text-align:right;">
                       <?php echo $row['memberName'];?>
                       </td>
                       <?php endif;?>     
							<td style="text-align:right;"><?php echo !empty($row['okOrderAmount'])
							? '￥'.number_format($row['okOrderAmount'],2, '.', ','):'--';?></td>
							<td style="text-align:right;"><?php echo !empty($row['okOrderNum'])?$row['okOrderNum']:'--';?></td>
                            
							<td style="text-align:right;"><?php echo !empty($row['perPrice'])? '￥'.number_format($row['perPrice'],2, '.', ','):'--';?></td>
                           
							<td style="text-align:right;"><?php echo !empty($row['installNum']) ? $row['installNum'] : '--';?></td>
                           
							<td style="text-align:right;"><?php echo !empty($row['installOkOrderNum'])? $row['installOkOrderNum'] : '--';?></td>
                         <td style="text-align:right;"><?php echo !empty($row['installOkOrderAmount'])
							? '￥'.number_format($row['installOkOrderAmount'],2, '.', ','):'--';?></td>
                          
						</tr>
                        
                        <tr class="data-show-<?php echo ($key+2)%2+1;?>">
                        <?php if($key == 0):?>
                        <td colspan="9"  id="expandAdMemberContent" style=" padding:0px 0px;" ></td>
                        <?php else:?>
                        <td colspan="9"  id="expandFreeMemberContent" style=" padding:0px 0px;" ></td>
                        <?php endif;?>
                        </tr>
                        <?php endforeach;?>
<?php else:?>
<tr><td colspan="9" align="center">没有找到相关记录！</td></tr>

<?php endif;?>

					</table>
                <br />
                <input type="hidden" id="expandAdMemberSourceUrl" name="expandAdMemberSourceUrl"  value="<?php echo $this->projectUrl(array('action'=>'ad-member-source'));?>" />
                <input type="hidden" id="expandAdMemberSubSourceUrl" name="expandAdMemberSubSourceUrl"  value="<?php echo $this->projectUrl(array('action'=>'ad-member-sub-source'));?>" />
                <input type="hidden" id="freeAdMemberSourceUrl" name="freeAdMemberSourceUrl" value="<?php echo $this->projectUrl(array('action'=>'free-member-source'));?>" 
                />
                 <input type="hidden" id="freeAdMemberSubSourceUrl" name="freeAdMemberSubSourceUrl"  value="<?php echo $this->projectUrl(array('action'=>'free-member-sub-source'));?>" />
			  </form>
		</div>
		</div>
	</div>
</body>
</html>